import Vue from 'vue'
import Router from 'vue-router'
import Main from '../components/Main'
import Login from '../components/Login'

Vue.use(Router)
const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}

export default new Router({
    mode: 'history',
    routes: [{
        //    路由地址
        path: '/',
        //    跳转的组件
        component: Login,
        },
        {
            //    路由地址
            path: '/main',
            //    跳转的组件
            component: Main,
            // 重定向
            redirect: "/Item_info",
            children: [
                
                {
                    path: "/Item_info",
                    name: "Item_info",
                    component: () => import("../components/Item_info")
                },
                {
                    path: "/note",
                    name: "Note",
                    component: () => import("../components/Note")
                    
                },
                {
                    path: "/register",
                    name: "Register",
                    component: () => import("../components/Register")
                },
                {
                    path: "/register1",
                    name: "Register1",
                    component: () => import("../components/Register1")
                },
                {
                    path: "/apply",
                    name: "Apply",
                    component: () => import("../components/Apply")
                },
                {
                    path: "/content",
                    name: "Content",
                    component: () => import("../components/Content")
                },
                {
                    path: "/text",
                    name: "Text",
                    component: () => import("../components/Text")
                },
                {
                  path: "/emotion",
                  name: "Emotion",
                    component: () => import("../components/Emotion")
                },
                {
                  path:"/euser",
                  name:"Euser",
                  component: () => import("../components/Euser")
                },
                {
                    path:"/exceed",
                    name:"Exceed",
                    component: () => import("../components/Exceed")
                  },
                  {
                    path:"/enrolled",
                    name:"Enrolled",
                    component: () => import("../components/Enrolled")
                  },
                  {
                    path:"/sign",
                    name:"Sign",
                    component: () => import("../components/Sign")
                  },

                {
                    path:"/volunteerinfo",
                    name:"Volunteerinfo",
                    component: () => import("../components/Volunteerinfo")
                },
                {
                    path:"/volunteerinfo1",
                    name:"Volunteerinfo1",
                    component: () => import("../components/Volunteerinfo1")
                },
            ]
        }
    ]
})

